package com.ciei.dpagm.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ciei.dpagm.common.service.BaseService;
import com.ciei.dpagm.entity.ChipPinFunction;
import com.ciei.dpagm.mapper.ChipPinFunctionMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangyan
 * @date 2023/05/08
 */
@Service
public class ChipPinFunctionService extends BaseService<ChipPinFunctionMapper, ChipPinFunction> {

    /**
     * 获取列表
     * @param chipId
     * @param pinNameList
     * @return
     */
    public List<ChipPinFunction> getList(Integer chipId,List<String> pinNameList){
        if(pinNameList.isEmpty()){
            return new ArrayList<>();
        }
        LambdaQueryWrapper<ChipPinFunction> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(ChipPinFunction::getChipId,chipId)
                .in(ChipPinFunction::getPinName,pinNameList);
        return list(lambdaQueryWrapper);
    }

}
